#include <iostream>
#include <ctime>
#include "User.h"
#include "Time.h"
using namespace std;

string sayHello(time_t now, string userName) {
	User user = User(userName);
	Time time = Time(now);
	return user.greet() + ". " + time.greet();
}

int main() {
	time_t now = time(0);
	string user = "John";
	cout << sayHello(now, user) << endl;

	tm* morning = localtime(&now);
	morning->tm_hour = 7;
	time_t am = mktime(morning);
	cout << sayHello(am, user) << endl;

	tm* afternoon = localtime(&now);
	afternoon->tm_hour = 13;
	time_t pm = mktime(afternoon);
	cout << sayHello(pm, user) << endl;

	tm* night = localtime(&now);
	night->tm_hour = 20;
	time_t nt = mktime(night);
	cout << sayHello(nt, user) << endl;

	return 0;
}
